<?php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Authorization, Content-Type, Access-Control-Allow-Headers, X-Requested-With');
header('Access-Control-Allow-Methods: *');

/**   ==============   Wap Api  ============   */

Route::namespace('Wap')->group(function () {

    // wap端手机号登录
    Route::post('login', 'LoginController@login');

    // 社会化登录 、微信登录 、三方登录
    Route::post('socials/{social_type}/login', 'LoginController@socialLogin');

    // 微信端首页
    Route::get('home', 'HomeController@index');

    // 广告信息
    Route::get('ad_lists', 'HomeController@adLists');

    // 扫描车架号
    Route::get('scan', 'HomeController@scanFrameNo');

    // 文字识别
    Route::post('text_ocr', 'HomeController@textOcr');

    // 查询是否有优惠券
    Route::get('coupon', 'MyController@getCoupon');

    // 私有路由，需要登录才能访问
    Route::group(['middleware' => 'low-token'], function () {

        // 领取优惠券
        Route::post('coupon', 'MyController@receiveCoupon');

        // 查看鉴定报告
        Route::post('car/see_appraisal', 'CarController@seeAppraisalReport');

        // 下订单
        Route::post('orders', 'OrdersController@store');

        // 微信支付接口
        Route::get('payment/{order}/wechat', 'PaymentController@payByWechat');

        // 我的订单
        Route::get('my-orders', 'MyController@myOrders');

        Route::get('my', 'MyController@index');

    });

});






